package com.siyoumi.app.test.sys;

import com.siyoumi.app.entity.FunRecord;
import com.siyoumi.app.modules.fun.service.SvcFun;
import com.siyoumi.app.sys.entity.AesKi;
import com.siyoumi.component.XApp;
import com.siyoumi.component.http.XHttpContext;
import com.siyoumi.entity.SysAccsuperConfig;
import com.siyoumi.test.TestController;
import com.siyoumi.test.annotation.TestClass;
import com.siyoumi.util.XAes;
import com.siyoumi.util.XReturn;
import com.siyoumi.util.XStr;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

//接口
@TestClass(
        runMethods = "login_test"
)
@Slf4j
@RestController
@RequestMapping("/test/test_fun")
public class testFun
        extends TestController {
    //http://dev.x.siyoumi.com/test/test_fun/sub_fun?x=yituky
    @SneakyThrows
    @GetMapping("sub_fun")
    public XReturn subFun() {
        XReturn r = XReturn.getR(0);

        Integer num = -2;
        String key = XApp.getUUID();
        FunRecord record = SvcFun.getBean().add(key, "1238613367703207958", key, "test", num, "test");

        r.setData("record", record);
        return r;
    }
}
